package com.jzh.thread;


class MyThread03 extends Thread{
    @Override
    public void run() {

        while (true){
            try {

                System.out.println("mythread03----");

                Thread.sleep(1000);
//                currentThread().join();
//                currentThread().yield();
//                Thread.yield();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            }
        }

}

class MyThread04 extends Thread{
    @Override
    public void run() {
        while (true){
            try {

                System.out.println("mythread04");
//                currentThread().join();
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}



public class Thread02 {
    public static void main(String[] args) throws InterruptedException {
        Thread t3 = new MyThread03();
        Thread t4 = new MyThread04();
        t3.start();
//        t3.yield();
//        t3.join(5000);
//        t3.wait();
        t4.start();
//        t4.join();




    }
}
